package com.yunmai.bookstore.mapper;

import com.yunmai.bookstore.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface UserMapper {
    @Insert("insert into user(username, password, email, created_at) values(#{username}, #{password}, #{email}, #{createdAt})")
    void insert(String username, String password, String email, LocalDateTime createdAt);
    @Select("select * from user where user.user_id = #{userId}")
    User selectByPrimaryKey(int userId);
}
